<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The small3d library: xcode</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_s.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The small3d library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">xcode </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>On MacOS, the <a class="el" href="namespacesmall3d.html">small3d</a> unit tests and sample game can be built from the command line, just like on any other platform. However you might want to create an Xcode project, in order to use the Xcode debugger for example.</p>
<p>First of all, after the dependency preparation script (<code>deps/prapare.sh</code> in this case) has been executed, <a class="el" href="namespacesmall3d.html">small3d</a> together with its unit tests can be configured and built for Xcode as follows (execute from the main directory): </p><pre class="fragment">mkdir build
cd build
cmake .. -G"Xcode"
cmake --build .
</pre><p>The created project, <code>build/small3d.xcodeproj</code> can then be opened in Xcode.</p>
<p>There are two things that need to be taken care of before proceeding to run and debug the unit tests though. First of all, from the Project Navigator, click on <code><a class="el" href="namespacesmall3d.html">small3d</a></code>, and then on the <code>unittests</code> target. Select Build Settings and scroll down to User-Defined. There, the <code>CONFIGURATION_BUILD_DIR</code> variable needs to be set to the <code>bin</code> directory in all cases, for example <code>/Users/me/Source/small3d/build/bin/</code>, rather than the differentiated directories it is set to by default, e.g. <code>bin/Debug</code>, <code>bin/Release</code>, etc.</p>
<p>The other problem is that, if you have set some Vulkan-related environment variables in bash / zsh, Xcode is not aware of them. Select the <code>unittests</code> target and then select Edit Scheme. Then select Run Debug, Arguments and add the necessary Environment Variables. They cannot be exactly the same as in <code>.zprofile</code> or <code>.bash_profile</code>. For example <code>VULKAN_SDK</code> does not need to be defined in this case and its value cannot be reused as <code>$VULKAN_SDK</code>anyway. They should look somewhat like these (note that, in my case, I do not install the Vulkan SDK. I just unzip it in my <code>Software</code> directory. So your specific path locations may vary): </p><pre class="fragment">PATH=$PATH:/Users/user/Software/vulkansdk-macos-1.2.154.0/macOS/bin
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/user/Software/vulkansdk-macos-1.2.154.0/macOS/lib
VK_LAYER_PATH=/Users/user/Software/vulkansdk-macos-1.2.154.0/macOS/share/vulkan/explicit_layer.d
VK_ICD_FILENAMES=/Users/user/Software/vulkansdk-macos-1.2.154.0/MoltenVK/dylib/macOS/MoltenVK_icd.json
</pre> </div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
